<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Dropdown 下拉菜单 | MyUI 4.x</title>
    <meta name="generator" content="VuePress 1.5.4">
    <link rel="icon" href="/my/favicon.ico">
    <script>
      var _hmt = _hmt || [];
      (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?c4e5f73318b5cb0c389e3d9a05f831cc";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
    <meta name="description" content="MyUI是美亚柏科旗下新德汇出品的Web前端一站式项目工程框架，专注于公检法行业中台系统快速搭建，框架已在多个项目实战检验。">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <link rel="preload" href="/my/assets/css/0.styles.810d4cba.css" as="style"><link rel="preload" href="/my/assets/js/app.2dbd0b81.js" as="script"><link rel="preload" href="/my/assets/js/493.009afff8.js" as="script"><link rel="preload" href="/my/assets/js/1310.6da42cc3.js" as="script"><link rel="preload" href="/my/assets/js/1031.8d6cd2c9.js" as="script">
    <link rel="stylesheet" href="/my/assets/css/0.styles.810d4cba.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/my/" class="home-link router-link-active"><img src="/my/img/logo.png" alt="MyUI 4.x" class="logo"> <span class="site-name can-hide">MyUI 4.x</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><a href="/my/ui/pages/" class="nav-link">
  页面
</a></div><div class="nav-item"><a href="http://newgateway.gitee.io/my-web/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow down"></span></button> <button type="button" aria-label="JSDoc" class="mobile-dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><a href="/my/ui/pages/" class="nav-link">
  页面
</a></div><div class="nav-item"><a href="http://newgateway.gitee.io/my-web/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow down"></span></button> <button type="button" aria-label="JSDoc" class="mobile-dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Basic</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Form</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Data</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Notice</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>Navigation</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/my/element/breadcrumb.html" class="sidebar-link">Breadcrumb 面包屑</a></li><li><a href="/my/element/dropdown.html" aria-current="page" class="active sidebar-link">Dropdown 下拉菜单</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/my/element/dropdown.html#基础用法" class="sidebar-link">基础用法</a></li><li class="sidebar-sub-header"><a href="/my/element/dropdown.html#触发对象" class="sidebar-link">触发对象</a></li><li class="sidebar-sub-header"><a href="/my/element/dropdown.html#触发方式" class="sidebar-link">触发方式</a></li><li class="sidebar-sub-header"><a href="/my/element/dropdown.html#菜单隐藏方式" class="sidebar-link">菜单隐藏方式</a></li><li class="sidebar-sub-header"><a href="/my/element/dropdown.html#指令事件" class="sidebar-link">指令事件</a></li><li class="sidebar-sub-header"><a href="/my/element/dropdown.html#不同尺寸" class="sidebar-link">不同尺寸</a></li><li class="sidebar-sub-header"><a href="/my/element/dropdown.html#dropdown-attributes" class="sidebar-link">Dropdown Attributes</a></li><li class="sidebar-sub-header"><a href="/my/element/dropdown.html#dropdown-slots" class="sidebar-link">Dropdown Slots</a></li><li class="sidebar-sub-header"><a href="/my/element/dropdown.html#dropdown-events" class="sidebar-link">Dropdown Events</a></li><li class="sidebar-sub-header"><a href="/my/element/dropdown.html#dropdown-menu-item-attributes" class="sidebar-link">Dropdown Menu Item Attributes</a></li></ul></li><li><a href="/my/element/menu.html" class="sidebar-link">NavMenu 导航菜单</a></li><li><a href="/my/element/page-header.html" class="sidebar-link">PageHeader 页头</a></li><li><a href="/my/element/steps.html" class="sidebar-link">Steps 步骤条</a></li><li><a href="/my/element/tabs.html" class="sidebar-link">Tabs 标签页</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Others</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="dropdown-下拉菜单"><a href="#dropdown-下拉菜单" class="header-anchor">#</a> Dropdown 下拉菜单</h1> <p>将动作或菜单折叠到下拉菜单中。</p> <h2 id="基础用法"><a href="#基础用法" class="header-anchor">#</a> 基础用法</h2> <p>移动到下拉菜单上，展开更多操作。</p> <!----><h2 id="触发对象"><a href="#触发对象" class="header-anchor">#</a> 触发对象</h2> <p>可使用按钮触发下拉菜单。</p> <!----><h2 id="触发方式"><a href="#触发方式" class="header-anchor">#</a> 触发方式</h2> <p>可以配置 click 激活或者 hover 激活。</p> <!----><h2 id="菜单隐藏方式"><a href="#菜单隐藏方式" class="header-anchor">#</a> 菜单隐藏方式</h2> <p>可以<code>hide-on-click</code>属性来配置。</p> <!----><h2 id="指令事件"><a href="#指令事件" class="header-anchor">#</a> 指令事件</h2> <p>点击菜单项后会触发事件，用户可以通过相应的菜单项 key 进行不同的操作</p> <!----><h2 id="不同尺寸"><a href="#不同尺寸" class="header-anchor">#</a> 不同尺寸</h2> <p>Dropdown 组件提供除了默认值以外的三种尺寸，可以在不同场景下选择合适的尺寸。</p> <!----><h2 id="dropdown-attributes"><a href="#dropdown-attributes" class="header-anchor">#</a> Dropdown Attributes</h2> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>type</td> <td>菜单按钮类型，同 Button 组件(只在<code>split-button</code>为 true 的情况下有效)</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>size</td> <td>菜单尺寸，在<code>split-button</code>为 true 的情况下也对触发按钮生效</td> <td>string</td> <td>medium / small / mini</td> <td>—</td></tr> <tr><td>split-button</td> <td>下拉触发元素呈现为按钮组</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>placement</td> <td>菜单弹出位置</td> <td>string</td> <td>top/top-start/top-end/bottom/bottom-start/bottom-end</td> <td>bottom-end</td></tr> <tr><td>trigger</td> <td>触发下拉的行为</td> <td>string</td> <td>hover, click</td> <td>hover</td></tr> <tr><td>hide-on-click</td> <td>是否在点击菜单项后隐藏菜单</td> <td>boolean</td> <td>—</td> <td>true</td></tr> <tr><td>show-timeout</td> <td>展开下拉菜单的延时（仅在 trigger 为 hover 时有效）</td> <td>number</td> <td>—</td> <td>250</td></tr> <tr><td>hide-timeout</td> <td>收起下拉菜单的延时（仅在 trigger 为 hover 时有效）</td> <td>number</td> <td>—</td> <td>150</td></tr> <tr><td>tabindex</td> <td>Dropdown 组件的 <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex" target="_blank" rel="noopener noreferrer">tabindex<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></td> <td>number</td> <td>—</td> <td>0</td></tr></tbody></table> <h2 id="dropdown-slots"><a href="#dropdown-slots" class="header-anchor">#</a> Dropdown Slots</h2> <table><thead><tr><th>Name</th> <th>说明</th></tr></thead> <tbody><tr><td>—</td> <td>触发下拉列表显示的元素。 注意： 必须是一个元素或者或者组件</td></tr> <tr><td>dropdown</td> <td>下拉列表，通常是 <code>&lt;el-dropdown-menu&gt;</code> 组件</td></tr></tbody></table> <h2 id="dropdown-events"><a href="#dropdown-events" class="header-anchor">#</a> Dropdown Events</h2> <table><thead><tr><th>事件名称</th> <th>说明</th> <th>回调参数</th></tr></thead> <tbody><tr><td>click</td> <td><code>split-button</code> 为 true 时，点击左侧按钮的回调</td> <td>—</td></tr> <tr><td>command</td> <td>点击菜单项触发的事件回调</td> <td>dropdown-item 的指令</td></tr> <tr><td>visible-change</td> <td>下拉框出现/隐藏时触发</td> <td>出现则为 true，隐藏则为 false</td></tr></tbody></table> <h2 id="dropdown-menu-item-attributes"><a href="#dropdown-menu-item-attributes" class="header-anchor">#</a> Dropdown Menu Item Attributes</h2> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>command</td> <td>指令</td> <td>string/number/object</td> <td>—</td> <td>—</td></tr> <tr><td>disabled</td> <td>禁用</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>divided</td> <td>显示分割线</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>icon</td> <td>图标类名</td> <td>string</td> <td>—</td> <td>—</td></tr></tbody></table></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/my/element/breadcrumb.html" class="prev">
        Breadcrumb 面包屑
      </a></span> <span class="next"><a href="/my/element/menu.html">
        NavMenu 导航菜单
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/my/assets/js/app.2dbd0b81.js" defer></script><script src="/my/assets/js/493.009afff8.js" defer></script><script src="/my/assets/js/1310.6da42cc3.js" defer></script><script src="/my/assets/js/1031.8d6cd2c9.js" defer></script>
  </body>
</html>
